package edu.zut.cs.software.cms.module.teacher.domain;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

import edu.zut.cs.software.cms.base.domain.BaseTreeEntity;

@Entity
@Table(name="T_COLLEGE")
@NamedQueries({ @NamedQuery(name = "College.getRoot", query = "select m from College m where m.parent is null") })
public class College extends BaseTreeEntity<College,Long>{ 
	private static final long serialVersionUID = 4373909818672794337L;
	
	/*
	 * college name
	 */
	@Column
	String name;
	
	@OneToMany(mappedBy = "college", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	@JsonIgnore
	List<Teacher> teacher;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Teacher> getTeacher() {
		return teacher;
	}

	public void setTeacher(List<Teacher> teacher) {
		this.teacher = teacher;
	}


}
